home *** CD-ROM | disk | FTP | other *** search
- From: Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
- Date: Mon, 11 Jul 94 10:36:14 +0200
- Message-Id: <9407110836.AA25298@issan.informatik.uni-dortmund.de>
- To: Stephen.Usher@earth.ox.ac.uk
- In-Reply-To: <21204.9407110710@earth.ox.ac.uk> (message from Stephen Usher on Mon, 11 Jul 1994 08:10:13 +0100 (BST))
- Subject: Re: MiNTlib (I think I'm on pl43): Bug in sprintf().
-
- Stephen Usher <Stephen.Usher@earth.ox.ac.uk> writes:
-
- |> When a statement such as the following is run sprintf terminates after the
- |> first argument:-
-
- |> sprintf((char *)temp, "%c%c%c%c%s%c%c", IAC, SB, TELOPT_TERMTYPE,
- |> TELOPT_QUAL, term, IAC, SB);
-
- |> where IAC, SB, TELOPT* are all non-ACSII characters with the top bit
- |> set, ie. 127 < x < 256. The first two are actually (from memory)
- |> 0xff and 0xfa.
-
- |> All you get in temp is the first byte, ie. 0xff. printf() works correctly.
-
- Here is a patch:
-
- --- sprintf.c~ Tue Oct 12 08:19:02 1993
- +++ sprintf.c Mon Jul 11 10:31:28 1994
- @@ -12,7 +12,7 @@ sputc (ch, fp)
- {
- char **bufp = (char **) fp;
- *(*bufp)++ = ch;
- - return ch;
- + return ch & 0xff;
- }
-
- #ifdef __STDC__
-
- --
- +------------------------------------------------------------------------+
- Andreas Schwab "And now for something
- schwab@ls5.informatik.uni-dortmund.de completely different"
-